<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>linkedmap.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="closure_goog_structs_linkedmap.js.html">linkedmap.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2007 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>/**
<a name="line16"></a> * @fileoverview A LinkedMap data structure that is accessed using key/value
<a name="line17"></a> * pairs like an ordinary Map, but which guarantees a consistent iteration
<a name="line18"></a> * order over its entries. The iteration order is either insertion order (the
<a name="line19"></a> * default) or ordered from most recent to least recent use. By setting a fixed
<a name="line20"></a> * size, the LRU version of the LinkedMap makes an effective object cache. This
<a name="line21"></a> * data structure is similar to Java&#39;s LinkedHashMap.
<a name="line22"></a> *
<a name="line23"></a> * @author brenneman@google.com (Shawn Brenneman)
<a name="line24"></a> */
<a name="line25"></a>
<a name="line26"></a>
<a name="line27"></a>goog.provide(&#39;goog.structs.LinkedMap&#39;);
<a name="line28"></a>
<a name="line29"></a>goog.require(&#39;goog.structs.Map&#39;);
<a name="line30"></a>
<a name="line31"></a>
<a name="line32"></a>
<a name="line33"></a>/**
<a name="line34"></a> * Class for a LinkedMap datastructure, which combines O(1) map access for
<a name="line35"></a> * key/value pairs with a linked list for a consistent iteration order. Sample
<a name="line36"></a> * usage:
<a name="line37"></a> *
<a name="line38"></a> * &lt;pre&gt;
<a name="line39"></a> * var m = new LinkedMap();
<a name="line40"></a> * m.set(&#39;param1&#39;, &#39;A&#39;);
<a name="line41"></a> * m.set(&#39;param2&#39;, &#39;B&#39;);
<a name="line42"></a> * m.set(&#39;param3&#39;, &#39;C&#39;);
<a name="line43"></a> * alert(m.getKeys()); // param1, param2, param3
<a name="line44"></a> *
<a name="line45"></a> * var c = new LinkedMap(5, true);
<a name="line46"></a> * for (var i = 0; i &lt; 10; i++) {
<a name="line47"></a> *   c.set(&#39;entry&#39; + i, false);
<a name="line48"></a> * }
<a name="line49"></a> * alert(c.getKeys()); // entry9, entry8, entry7, entry6, entry5
<a name="line50"></a> *
<a name="line51"></a> * c.set(&#39;entry5&#39;, true);
<a name="line52"></a> * c.set(&#39;entry1&#39;, false);
<a name="line53"></a> * alert(c.getKeys()); // entry1, entry5, entry9, entry8, entry7
<a name="line54"></a> * &lt;/pre&gt;
<a name="line55"></a> *
<a name="line56"></a> * @param {number=} opt_maxCount The maximum number of objects to store in the
<a name="line57"></a> *     LinkedMap. If unspecified or 0, there is no maximum.
<a name="line58"></a> * @param {boolean=} opt_cache When set, the LinkedMap stores items in order
<a name="line59"></a> *     from most recently used to least recently used, instead of insertion
<a name="line60"></a> *     order.
<a name="line61"></a> * @constructor
<a name="line62"></a> */
<a name="line63"></a>goog.structs.LinkedMap = function(opt_maxCount, opt_cache) {
<a name="line64"></a>  /**
<a name="line65"></a>   * The maximum number of entries to allow, or null if there is no limit.
<a name="line66"></a>   * @type {?number}
<a name="line67"></a>   * @private
<a name="line68"></a>   */
<a name="line69"></a>  this.maxCount_ = opt_maxCount || null;
<a name="line70"></a>
<a name="line71"></a>  /**
<a name="line72"></a>   * @type {boolean}
<a name="line73"></a>   * @private
<a name="line74"></a>   */
<a name="line75"></a>  this.cache_ = !!opt_cache;
<a name="line76"></a>
<a name="line77"></a>  this.map_ = new goog.structs.Map();
<a name="line78"></a>
<a name="line79"></a>  this.head_ = new goog.structs.LinkedMap.Node_(&#39;&#39;, undefined);
<a name="line80"></a>  this.head_.next = this.head_.prev = this.head_;
<a name="line81"></a>};
<a name="line82"></a>
<a name="line83"></a>
<a name="line84"></a>/**
<a name="line85"></a> * Finds a node and updates it to be the most recently used.
<a name="line86"></a> * @param {string} key The key of the node.
<a name="line87"></a> * @return {goog.structs.LinkedMap.Node_} The node or null if not found.
<a name="line88"></a> * @private
<a name="line89"></a> */
<a name="line90"></a>goog.structs.LinkedMap.prototype.findAndMoveToTop_ = function(key) {
<a name="line91"></a>  var node = /** @type {goog.structs.LinkedMap.Node_} */ (this.map_.get(key));
<a name="line92"></a>  if (node) {
<a name="line93"></a>    if (this.cache_) {
<a name="line94"></a>      node.remove();
<a name="line95"></a>      this.insert_(node);
<a name="line96"></a>    }
<a name="line97"></a>  }
<a name="line98"></a>  return node;
<a name="line99"></a>};
<a name="line100"></a>
<a name="line101"></a>
<a name="line102"></a>/**
<a name="line103"></a> * Retrieves the value for a given key. If this is a caching LinkedMap, the
<a name="line104"></a> * entry will become the most recently used.
<a name="line105"></a> * @param {string} key The key to retrieve the value for.
<a name="line106"></a> * @param {*=} opt_val A default value that will be returned if the key is
<a name="line107"></a> *     not found, defaults to undefined.
<a name="line108"></a> * @return {*} The retrieved value.
<a name="line109"></a> */
<a name="line110"></a>goog.structs.LinkedMap.prototype.get = function(key, opt_val) {
<a name="line111"></a>  var node = this.findAndMoveToTop_(key);
<a name="line112"></a>  return node ? node.value : opt_val;
<a name="line113"></a>};
<a name="line114"></a>
<a name="line115"></a>
<a name="line116"></a>/**
<a name="line117"></a> * Retrieves the value for a given key without updating the entry to be the
<a name="line118"></a> * most recently used.
<a name="line119"></a> * @param {string} key The key to retrieve the value for.
<a name="line120"></a> * @param {*=} opt_val A default value that will be returned if the key is
<a name="line121"></a> *     not found.
<a name="line122"></a> * @return {*} The retrieved value.
<a name="line123"></a> */
<a name="line124"></a>goog.structs.LinkedMap.prototype.peekValue = function(key, opt_val) {
<a name="line125"></a>  var node = this.map_.get(key);
<a name="line126"></a>  return node ? node.value : opt_val;
<a name="line127"></a>};
<a name="line128"></a>
<a name="line129"></a>
<a name="line130"></a>/**
<a name="line131"></a> * Sets a value for a given key. If this is a caching LinkedMap, this entry
<a name="line132"></a> * will become the most recently used.
<a name="line133"></a> * @param {string} key The key to retrieve the value for.
<a name="line134"></a> * @param {*} value A default value that will be returned if the key is
<a name="line135"></a> *     not found.
<a name="line136"></a> */
<a name="line137"></a>goog.structs.LinkedMap.prototype.set = function(key, value) {
<a name="line138"></a>  var node = this.findAndMoveToTop_(key);
<a name="line139"></a>  if (node) {
<a name="line140"></a>    node.value = value;
<a name="line141"></a>  } else {
<a name="line142"></a>    node = new goog.structs.LinkedMap.Node_(key, value);
<a name="line143"></a>    this.map_.set(key, node);
<a name="line144"></a>    this.insert_(node);
<a name="line145"></a>  }
<a name="line146"></a>};
<a name="line147"></a>
<a name="line148"></a>
<a name="line149"></a>/**
<a name="line150"></a> * Returns the value of the first node without making any modifications.
<a name="line151"></a> * @return {*} The value of the first node or undefined if the map is empty.
<a name="line152"></a> */
<a name="line153"></a>goog.structs.LinkedMap.prototype.peek = function() {
<a name="line154"></a>  return this.head_.next.value;
<a name="line155"></a>};
<a name="line156"></a>
<a name="line157"></a>
<a name="line158"></a>/**
<a name="line159"></a> * Returns the value of the last node without making any modifications.
<a name="line160"></a> * @return {*} The value of the last node or undefined if the map is empty.
<a name="line161"></a> */
<a name="line162"></a>goog.structs.LinkedMap.prototype.peekLast = function() {
<a name="line163"></a>  return this.head_.prev.value;
<a name="line164"></a>};
<a name="line165"></a>
<a name="line166"></a>
<a name="line167"></a>/**
<a name="line168"></a> * Removes the first node from the list and returns its value.
<a name="line169"></a> * @return {*} The value of the popped node, or undefined if the map was empty.
<a name="line170"></a> */
<a name="line171"></a>goog.structs.LinkedMap.prototype.shift = function() {
<a name="line172"></a>  return this.popNode_(this.head_.next);
<a name="line173"></a>};
<a name="line174"></a>
<a name="line175"></a>
<a name="line176"></a>/**
<a name="line177"></a> * Removes the last node from the list and returns its value.
<a name="line178"></a> * @return {*} The value of the popped node, or undefined if the map was empty.
<a name="line179"></a> */
<a name="line180"></a>goog.structs.LinkedMap.prototype.pop = function() {
<a name="line181"></a>  return this.popNode_(this.head_.prev);
<a name="line182"></a>};
<a name="line183"></a>
<a name="line184"></a>
<a name="line185"></a>/**
<a name="line186"></a> * Removes a value from the LinkedMap based on its key.
<a name="line187"></a> * @param {string} key The key to remove.
<a name="line188"></a> * @return {boolean} True if the entry was removed, false if the key was not
<a name="line189"></a> *     found.
<a name="line190"></a> */
<a name="line191"></a>goog.structs.LinkedMap.prototype.remove = function(key) {
<a name="line192"></a>  var node = /** @type {goog.structs.LinkedMap.Node_} */ (this.map_.get(key));
<a name="line193"></a>  if (node) {
<a name="line194"></a>    this.removeNode(node);
<a name="line195"></a>    return true;
<a name="line196"></a>  }
<a name="line197"></a>  return false;
<a name="line198"></a>};
<a name="line199"></a>
<a name="line200"></a>
<a name="line201"></a>/**
<a name="line202"></a> * Removes a node from the {@code LinkedMap}. It can be overridden to do
<a name="line203"></a> * further cleanup such as disposing of the node value.
<a name="line204"></a> * @param {!goog.structs.LinkedMap.Node_} node The node to remove.
<a name="line205"></a> * @protected
<a name="line206"></a> */
<a name="line207"></a>goog.structs.LinkedMap.prototype.removeNode = function(node) {
<a name="line208"></a>  node.remove();
<a name="line209"></a>  this.map_.remove(node.key);
<a name="line210"></a>};
<a name="line211"></a>
<a name="line212"></a>
<a name="line213"></a>/**
<a name="line214"></a> * @return {number} The number of items currently in the LinkedMap.
<a name="line215"></a> */
<a name="line216"></a>goog.structs.LinkedMap.prototype.getCount = function() {
<a name="line217"></a>  return this.map_.getCount();
<a name="line218"></a>};
<a name="line219"></a>
<a name="line220"></a>
<a name="line221"></a>/**
<a name="line222"></a> * @return {boolean} True if the cache is empty, false if it contains any items.
<a name="line223"></a> */
<a name="line224"></a>goog.structs.LinkedMap.prototype.isEmpty = function() {
<a name="line225"></a>  return this.map_.isEmpty();
<a name="line226"></a>};
<a name="line227"></a>
<a name="line228"></a>
<a name="line229"></a>/**
<a name="line230"></a> * Sets the maximum number of entries allowed in this object, truncating any
<a name="line231"></a> * excess objects if necessary.
<a name="line232"></a> * @param {number} maxCount The new maximum number of entries to allow.
<a name="line233"></a> */
<a name="line234"></a>goog.structs.LinkedMap.prototype.setMaxCount = function(maxCount) {
<a name="line235"></a>  this.maxCount_ = maxCount || null;
<a name="line236"></a>  if (this.maxCount_ != null) {
<a name="line237"></a>    this.truncate_(this.maxCount_);
<a name="line238"></a>  }
<a name="line239"></a>};
<a name="line240"></a>
<a name="line241"></a>
<a name="line242"></a>/**
<a name="line243"></a> * @return {!Array.&lt;string&gt;} The list of the keys in the appropriate order for
<a name="line244"></a> *     this LinkedMap.
<a name="line245"></a> */
<a name="line246"></a>goog.structs.LinkedMap.prototype.getKeys = function() {
<a name="line247"></a>  return this.map(function(val, key) {
<a name="line248"></a>    return key;
<a name="line249"></a>  });
<a name="line250"></a>};
<a name="line251"></a>
<a name="line252"></a>
<a name="line253"></a>/**
<a name="line254"></a> * @return {!Array} The list of the values in the appropriate order for
<a name="line255"></a> *     this LinkedMap.
<a name="line256"></a> */
<a name="line257"></a>goog.structs.LinkedMap.prototype.getValues = function() {
<a name="line258"></a>  return this.map(function(val, key) {
<a name="line259"></a>    return val;
<a name="line260"></a>  });
<a name="line261"></a>};
<a name="line262"></a>
<a name="line263"></a>
<a name="line264"></a>/**
<a name="line265"></a> * Tests whether a provided value is currently in the LinkedMap. This does not
<a name="line266"></a> * affect item ordering in cache-style LinkedMaps.
<a name="line267"></a> * @param {Object} value The value to check for.
<a name="line268"></a> * @return {boolean} Whether the value is in the LinkedMap.
<a name="line269"></a> */
<a name="line270"></a>goog.structs.LinkedMap.prototype.contains = function(value) {
<a name="line271"></a>  return this.some(function(el) {
<a name="line272"></a>    return el == value;
<a name="line273"></a>  });
<a name="line274"></a>};
<a name="line275"></a>
<a name="line276"></a>
<a name="line277"></a>/**
<a name="line278"></a> * Tests whether a provided key is currently in the LinkedMap. This does not
<a name="line279"></a> * affect item ordering in cache-style LinkedMaps.
<a name="line280"></a> * @param {string} key The key to check for.
<a name="line281"></a> * @return {boolean} Whether the key is in the LinkedMap.
<a name="line282"></a> */
<a name="line283"></a>goog.structs.LinkedMap.prototype.containsKey = function(key) {
<a name="line284"></a>  return this.map_.containsKey(key);
<a name="line285"></a>};
<a name="line286"></a>
<a name="line287"></a>
<a name="line288"></a>/**
<a name="line289"></a> * Removes all entries in this object.
<a name="line290"></a> */
<a name="line291"></a>goog.structs.LinkedMap.prototype.clear = function() {
<a name="line292"></a>  this.truncate_(0);
<a name="line293"></a>};
<a name="line294"></a>
<a name="line295"></a>
<a name="line296"></a>/**
<a name="line297"></a> * Calls a function on each item in the LinkedMap.
<a name="line298"></a> *
<a name="line299"></a> * @see goog.structs.forEach
<a name="line300"></a> * @param {Function} f The function to call for each item. The function takes
<a name="line301"></a> *     three arguments: the value, the key, and the LinkedMap.
<a name="line302"></a> * @param {Object=} opt_obj The object context to use as &quot;this&quot; for the
<a name="line303"></a> *     function.
<a name="line304"></a> */
<a name="line305"></a>goog.structs.LinkedMap.prototype.forEach = function(f, opt_obj) {
<a name="line306"></a>  for (var n = this.head_.next; n != this.head_; n = n.next) {
<a name="line307"></a>    f.call(opt_obj, n.value, n.key, this);
<a name="line308"></a>  }
<a name="line309"></a>};
<a name="line310"></a>
<a name="line311"></a>
<a name="line312"></a>/**
<a name="line313"></a> * Calls a function on each item in the LinkedMap and returns the results of
<a name="line314"></a> * those calls in an array.
<a name="line315"></a> *
<a name="line316"></a> * @see goog.structs.map
<a name="line317"></a> * @param {!Function} f The function to call for each item. The function takes
<a name="line318"></a> *     three arguments: the value, the key, and the LinkedMap.
<a name="line319"></a> * @param {Object=} opt_obj The object context to use as &quot;this&quot; for the
<a name="line320"></a> *     function.
<a name="line321"></a> * @return {!Array} The results of the function calls for each item in the
<a name="line322"></a> *     LinkedMap.
<a name="line323"></a> */
<a name="line324"></a>goog.structs.LinkedMap.prototype.map = function(f, opt_obj) {
<a name="line325"></a>  var rv = [];
<a name="line326"></a>  for (var n = this.head_.next; n != this.head_; n = n.next) {
<a name="line327"></a>    rv.push(f.call(opt_obj, n.value, n.key, this));
<a name="line328"></a>  }
<a name="line329"></a>  return rv;
<a name="line330"></a>};
<a name="line331"></a>
<a name="line332"></a>
<a name="line333"></a>/**
<a name="line334"></a> * Calls a function on each item in the LinkedMap and returns true if any of
<a name="line335"></a> * those function calls returns a true-like value.
<a name="line336"></a> *
<a name="line337"></a> * @see goog.structs.some
<a name="line338"></a> * @param {Function} f The function to call for each item. The function takes
<a name="line339"></a> *     three arguments: the value, the key, and the LinkedMap, and returns a
<a name="line340"></a> *     boolean.
<a name="line341"></a> * @param {Object=} opt_obj The object context to use as &quot;this&quot; for the
<a name="line342"></a> *     function.
<a name="line343"></a> * @return {boolean} Whether f evaluates to true for at least one item in the
<a name="line344"></a> *     LinkedMap.
<a name="line345"></a> */
<a name="line346"></a>goog.structs.LinkedMap.prototype.some = function(f, opt_obj) {
<a name="line347"></a>  for (var n = this.head_.next; n != this.head_; n = n.next) {
<a name="line348"></a>    if (f.call(opt_obj, n.value, n.key, this)) {
<a name="line349"></a>      return true;
<a name="line350"></a>    }
<a name="line351"></a>  }
<a name="line352"></a>  return false;
<a name="line353"></a>};
<a name="line354"></a>
<a name="line355"></a>
<a name="line356"></a>/**
<a name="line357"></a> * Calls a function on each item in the LinkedMap and returns true only if every
<a name="line358"></a> * function call returns a true-like value.
<a name="line359"></a> *
<a name="line360"></a> * @see goog.structs.some
<a name="line361"></a> * @param {Function} f The function to call for each item. The function takes
<a name="line362"></a> *     three arguments: the value, the key, and the Cache, and returns a
<a name="line363"></a> *     boolean.
<a name="line364"></a> * @param {Object=} opt_obj The object context to use as &quot;this&quot; for the
<a name="line365"></a> *     function.
<a name="line366"></a> * @return {boolean} Whether f evaluates to true for every item in the Cache.
<a name="line367"></a> */
<a name="line368"></a>goog.structs.LinkedMap.prototype.every = function(f, opt_obj) {
<a name="line369"></a>  for (var n = this.head_.next; n != this.head_; n = n.next) {
<a name="line370"></a>    if (!f.call(opt_obj, n.value, n.key, this)) {
<a name="line371"></a>      return false;
<a name="line372"></a>    }
<a name="line373"></a>  }
<a name="line374"></a>  return true;
<a name="line375"></a>};
<a name="line376"></a>
<a name="line377"></a>
<a name="line378"></a>/**
<a name="line379"></a> * Appends a node to the list. LinkedMap in cache mode adds new nodes to
<a name="line380"></a> * the head of the list, otherwise they are appended to the tail. If there is a
<a name="line381"></a> * maximum size, the list will be truncated if necessary.
<a name="line382"></a> *
<a name="line383"></a> * @param {goog.structs.LinkedMap.Node_} node The item to insert.
<a name="line384"></a> * @private
<a name="line385"></a> */
<a name="line386"></a>goog.structs.LinkedMap.prototype.insert_ = function(node) {
<a name="line387"></a>  if (this.cache_) {
<a name="line388"></a>    node.next = this.head_.next;
<a name="line389"></a>    node.prev = this.head_;
<a name="line390"></a>
<a name="line391"></a>    this.head_.next = node;
<a name="line392"></a>    node.next.prev = node;
<a name="line393"></a>  } else {
<a name="line394"></a>    node.prev = this.head_.prev;
<a name="line395"></a>    node.next = this.head_;
<a name="line396"></a>
<a name="line397"></a>    this.head_.prev = node;
<a name="line398"></a>    node.prev.next = node;
<a name="line399"></a>  }
<a name="line400"></a>
<a name="line401"></a>  if (this.maxCount_ != null) {
<a name="line402"></a>    this.truncate_(this.maxCount_);
<a name="line403"></a>  }
<a name="line404"></a>};
<a name="line405"></a>
<a name="line406"></a>
<a name="line407"></a>/**
<a name="line408"></a> * Removes elements from the LinkedMap if the given count has been exceeded.
<a name="line409"></a> * In cache mode removes nodes from the tail of the list. Otherwise removes
<a name="line410"></a> * nodes from the head.
<a name="line411"></a> * @param {number} count Number of elements to keep.
<a name="line412"></a> * @private
<a name="line413"></a> */
<a name="line414"></a>goog.structs.LinkedMap.prototype.truncate_ = function(count) {
<a name="line415"></a>  for (var i = this.map_.getCount(); i &gt; count; i--) {
<a name="line416"></a>    this.removeNode(this.cache_ ? this.head_.prev : this.head_.next);
<a name="line417"></a>  }
<a name="line418"></a>};
<a name="line419"></a>
<a name="line420"></a>
<a name="line421"></a>/**
<a name="line422"></a> * Removes the node from the LinkedMap if it is not the head, and returns
<a name="line423"></a> * the node&#39;s value.
<a name="line424"></a> * @param {!goog.structs.LinkedMap.Node_} node The item to remove.
<a name="line425"></a> * @return {*} The value of the popped node.
<a name="line426"></a> * @private
<a name="line427"></a> */
<a name="line428"></a>goog.structs.LinkedMap.prototype.popNode_ = function(node) {
<a name="line429"></a>  if (this.head_ != node) {
<a name="line430"></a>    this.removeNode(node);
<a name="line431"></a>  }
<a name="line432"></a>  return node.value;
<a name="line433"></a>};
<a name="line434"></a>
<a name="line435"></a>
<a name="line436"></a>
<a name="line437"></a>/**
<a name="line438"></a> * Internal class for a doubly-linked list node containing a key/value pair.
<a name="line439"></a> * @param {string} key The key.
<a name="line440"></a> * @param {*} value The value.
<a name="line441"></a> * @constructor
<a name="line442"></a> * @private
<a name="line443"></a> */
<a name="line444"></a>goog.structs.LinkedMap.Node_ = function(key, value) {
<a name="line445"></a>  this.key = key;
<a name="line446"></a>  this.value = value;
<a name="line447"></a>};
<a name="line448"></a>
<a name="line449"></a>
<a name="line450"></a>/**
<a name="line451"></a> * The next node in the list.
<a name="line452"></a> * @type {!goog.structs.LinkedMap.Node_}
<a name="line453"></a> */
<a name="line454"></a>goog.structs.LinkedMap.Node_.prototype.next;
<a name="line455"></a>
<a name="line456"></a>
<a name="line457"></a>/**
<a name="line458"></a> * The previous node in the list.
<a name="line459"></a> * @type {!goog.structs.LinkedMap.Node_}
<a name="line460"></a> */
<a name="line461"></a>goog.structs.LinkedMap.Node_.prototype.prev;
<a name="line462"></a>
<a name="line463"></a>
<a name="line464"></a>/**
<a name="line465"></a> * Causes this node to remove itself from the list.
<a name="line466"></a> */
<a name="line467"></a>goog.structs.LinkedMap.Node_.prototype.remove = function() {
<a name="line468"></a>  this.prev.next = this.next;
<a name="line469"></a>  this.next.prev = this.prev;
<a name="line470"></a>
<a name="line471"></a>  delete this.prev;
<a name="line472"></a>  delete this.next;
<a name="line473"></a>};
</pre>


</body>
</html>
